import requests

# API URL
url = "http://10.5.1.48:15672/api/queues"

# 认证信息，替换为你的用户名和密码
auth = ("cloud", "7#BD2CFc3TBV}7m7z")

# 发送 GET 请求
response = requests.get(url, auth=auth)

# 检查请求是否成功
if response.status_code == 200:
    queues = response.json()  # 解析 JSON 数据
    # 过滤 node 为 'rabbit@aw-node-01' 的队列
    filtered_queues = [
        queue["name"] for queue in queues if queue["node"] == "rabbit@aw-node-03"
    ]
    # 打印队列名称
    for name in filtered_queues:
        print(name)
else:
    print("获取数据错误，状态码为：", response.status_code)
